package com.huike.web.controller.clues;

import com.huike.clues.domain.TbClueTrackRecord;
import com.huike.clues.domain.vo.ClueTrackRecordVo;
import com.huike.clues.service.ITbClueTrackRecordService;
import com.huike.common.constant.HttpStatus;
import com.huike.common.core.controller.BaseController;
import com.huike.common.core.domain.AjaxResult;
import com.huike.common.core.page.PageDomain;
import com.huike.common.core.page.TableDataInfo;
import com.huike.common.core.page.TableSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 线索跟进记录Controller
 * @date 2021-04-22
 */
@RestController
@RequestMapping("/clues/record")
public class TbClueTrackRecordController extends BaseController {

    @Autowired(required = false)
    private ITbClueTrackRecordService iTbClueTrackRecordService;

    @GetMapping("/list")
    public TableDataInfo getRecordList(Long clueId) {
        TbClueTrackRecord tbClueTrackRecord = new TbClueTrackRecord();
        tbClueTrackRecord.setClueId(clueId);
        return getDataTable(iTbClueTrackRecordService.selectTbClueTrackRecordList(tbClueTrackRecord));
    }
    @PostMapping
    public AjaxResult addList(@RequestBody ClueTrackRecordVo clueTrackRecordVo){
        iTbClueTrackRecordService.insertTbClueTrackRecord(clueTrackRecordVo);
        return  AjaxResult.success();
    }
}